package 语雀题目21至55;

import java.util.Scanner;

/**
 * ClassName: 求阶乘和
 * Package: 语雀21至40
 * Description:
 *
 * @Author fjorid
 * @Create 2025/1/6 20:20
 * @Version 1.0
 */
public class 求阶乘和28 {
    public static void main(String[] args) {
        int n,sum=0,factorial=1;
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        for (int i = 1; i <=n; i++) {
            factorial *= i;
            sum += factorial;
        }
        System.out.println(sum);
    }
}
